#include "bullet.h"

Bullet::Bullet(QPointF _pos,QPixmap _pixmap,int _type, QPointF _speedVec){
    this->setPos(_pos);
    this->setPixmap(_pixmap);
    this->mBulletType = _type;
    this->mSpeedVec = _speedVec;
    mBulletSpeed = 6;

    //子弹微调
    this->setScale(0.5);//缩放子弹
    this->setX(this->x() - this->scale() * pixmap().width() / 2);
}

void Bullet::BulletMove(){
    this->moveBy(mSpeedVec.x()*mBulletSpeed, mSpeedVec.y()*mBulletSpeed);
}
